package com.joseph.test;

import java.util.Comparator;

import com.joseph.base.BaseModel;

/**
 * @description
 * @author Joseph_Mok
 * @date 2016年3月17日下午6:12:04
 */
public class User extends BaseModel implements Comparable <User>{

	private static final long serialVersionUID = 2076963540603189614L;
	
	private String name;
	private Double score;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getScore() {
		return score;
	}

	public void setScore(Double score) {
		this.score = score;
	}
	
	public User(String name, Double score) {
		super();
		this.name = name;
		this.score = score;
	}
	
	public User() {
		
	}

	@Override
	public int compareTo(User o) {
		return this.score > o.getScore() ? -1 : 1;
	}
	
	class UserNameCompartor implements Comparator <User> {
		@Override
		public int compare(User o1, User o2) {
			return o1.getName().compareToIgnoreCase(o2.getName());
		}
	}
}

